namespace DotNetNuke.UI.WebControls
{
    using System;
    using System.IO;
    using System.Web.UI;
    using System.Web.UI.Design;
    using System.Web.UI.WebControls;

    public class DNNMenuDesigner : ControlDesigner
    {
        public override string GetDesignTimeHtml()
        {
            DNNMenu component = (DNNMenu) this.Component;
            if (component.ID.Length > 0)
            {
                Unit unit;
                StringWriter writer = new StringWriter();
                HtmlTextWriter writer2 = new HtmlTextWriter(writer);
                Label label = new Label();
                label.CssClass = component.MenuBarCssClass + " " + component.DefaultNodeCssClass;
                label.Text = component.ID;
                if (component.Orientation == Orientation.Horizontal)
                {
                    unit = new Unit("100%");
                    label.Width = unit;
                }
                else
                {
                    unit = new Unit(500);
                    label.Height = unit;
                }
                label.RenderControl(writer2);
                return writer.ToString();
            }
            return null;
        }

        public override bool AllowResize
        {
            get
            {
                return false;
            }
        }
    }
}

